home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Book Chapters / 11 - Porting / Sample Code / Source READ ME < prev    next >
Text File  |  1995-06-08  |  2KB  |  26 lines

  1. ==================================
  2. Porting Chapter / Source Code
  3. ==================================
  4.  
  5. The source code included in this folder is utilitarian in nature. It includes Memory allocation and deallocation “helper” functions, cursor functions, error checking functions, and a small illustration about finding files.
  6.  
  7. Memory “Helper” Functions.
  8.  
  9. MemAlloc.h should be "#included" in your source files. Call the functions prototyped in that header file in order to allocate and deallocate memory on the Macintosh. You can also determine how much memory you have allocated (when checking for memory leaks, for instance). Add MemAlloc.c to your project as well.
  10.  
  11. Error Checking Functions.
  12.  
  13. These small, simple functions are easy to call and should make you more willing to write robust code. Running out of memory and the inability to load data should exit gracefully, not crash horribly. Examples of their use is included in ErrCheck.c. Simply “#include” ErrCheck.h in your source file and make sure you include the resources in ErrCheck.rsrc in your project or Rez compile.
  14.  
  15. Finding that File.
  16.  
  17. This handy function allows you to specify a file to be opened, and then either it will find it, allow the user to find it, or return FALSE. If it returns FALSE, either an error occurred (not too likely) or the user doesn’t want to find the file (more likely). Make sure you include the FindFile.rsrc and FindFile.c in your project.
  18.  
  19. Cursor Utilities.
  20.  
  21. Spin that cursor. Mop those floors...
  22.  
  23.  
  24. Douglas Grounds
  25. Lion Entertainment, Inc.
  26. June, 1995